package com.itheima.service.impl;

import com.itheima.mapper.RoleMapper;
import com.itheima.domain.Role;
import com.itheima.service.RoleService;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;

@Service("roleService")
public class RoleServiceImpl implements RoleService {

    @Resource(name = "roleMapper")
    private RoleMapper roleMapper;

    @Override
    public List<Role> list() {
            List<Role> roleList = roleMapper.findAll();;

            return roleList;
    }

    @Override
    public void save(Role role) {
        roleMapper.save(role);
    }
}
